home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 154
/
154.d81
/
king puzzle
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
111 lines
10 poke56,48:poke55,0:clr
20 dv=peek(186):ifdv<8thendv=8
30 sys57812"chess font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
40 sys57812"chess sprites",dv,0:poke780,0:poke781,0:poke782,48:sys65493
50 print"[147]";:poke53280,0
60 poke53281,10:poke646,0:poke53272,31:gosub870
70 :
80 rem title screen
90 :
100 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
110 print"[221] [221]";
120 print"[221] [176][192][192][192][174] [221]";
130 print"[221] [221] [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174] [221]";
140 print"[221] [173][192][192][192][189] [221] [221] [221] [221] [221]";
150 print"[221] [176][192][192][192][174] [221] [221] [221] [221] [221]";
160 print"[221] [221] [221] [221] [221] [221] [221] [221]";
170 print"[221] [173][192][192][192][189] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [221]";
180 print"[221] [176][192][192][192][174] [221] [221] [221] [221] [221]";
190 print"[221] [171][192][178][192][189] [221] [221] [221] [221] [221]";
200 print"[221] [189] [173][192][189] [221] [221] [221] [221] [221]";
210 print"[221] [176][192][174] [176] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [221]";
220 print"[221] [221] [221] [221] [221] [221] [221] [221] [221]";
230 print"[221] [189] [173][192][189] [221] [221] [221] [221] [221]";
240 print"[221] [176][192][192][192][174] [221] [221] [221] [221] [221]";
250 print"[221] [171][192][192] [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189] [221]";
260 print"[221] [173][192][192][192][189] [221]";
270 print"[221] [176][192][192][192][174] [221]";
280 print"[221] [171][192][178][192][189] [221]";
290 print"[221] [189] [173][192][189] [221]";
300 print"[221] [176][192][178][192][174][174] [176][176][192][192][174] [174] [176][189] [178] [176][192][174] [176][176][192][192][174] [221]";
310 print"[221] [221] [171][192][192][179][171][192][192] [171][192][179] [221] [221] [221] [221][221] [176][174] [221]";
320 print"[221] [177] [189] [173][173][192][192][189] [189] [173][174] [177] [189] [173][192][189][173][192][192][189] [221]";
330 print"[221] [221]";
340 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][157][148][192]";
342 fori=217to242:pokei,peek(i)or128:next
350 gosub940
352 tq=0:poke53370,0
354 tq=tq+1:geta$:ifa$=""andtq<200then354
356 poke53371,0
358 pokev+21,0
360 :
370 rem instruction screen
380 :
390 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
400 print"[221] [221]";
410 print"[221] [201]n 1922, the famous [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174] [221]";
420 print"[221] puzzler [200] [197] [196]udeney [221] [221] [221] [221] [221]";
430 print"[221] proposed this chess [221] [221] [221] [221] [221]";
440 print"[221] puzzle shown on the [221] [221] [221] [221] [221]";
450 print"[221] board at the right: [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [221]";
460 print"[221] [221] [221] [221] [221] [221]";
470 print"[221] [205]ove the white king[144] [221] [221] [221] [221] [221]";
480 print"[221] in the upper right[144] [221] [221] [221] [221] [221]";
490 print"[221] corner to the lower[144] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [221]";
500 print"[221] left corner with it[144] [221] [221] [221] [221] [221]";
510 print"[221] never entering the[144] [221] [221] [221] [221] [221]";
520 print"[221] center square.[144] [221] [221] [221] [221] [221]";
530 print"[221] [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189] [221]";
540 print"[221] [208]awns cannot move. [193]ll other pieces[144] [221]";
550 print"[221] move only within the 3x3 chessboard.[144] [221]";
560 print"[221] [221]";
570 print"[221] [208]ress (1) to pursue the chess puzzle [221]";
580 print"[221] without assistance and (2) to view a [221]";
590 print"[221] computer demonstration of one way to [221]";
600 print"[221] solve the chess puzzle. [207]ption? [221]";
610 print"[221] [221]";
620 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]";
630 print" [157][148] ";:gosub1000
632 fori=217to242:pokei,peek(i)or128:next
640 :
650 rem input option
660 :
670 p=1899:gosub800:poke198,0
680 poke204,0:poke207,0
690 geta$:ifa$<"1"ora$>"2"then680
700 a=val(a$)
710 print"[147]";:poke204,1:poke1020,a:pokev+21,0:poke53281,0
720 :
730 rem load main program
740 :
750 print"[147][146] load"chr$(34)"king.main"chr$(34)","dv:print""
760 poke198,4:poke631,13:poke632,82:poke633,213:poke634,13:end
770 :
780 rem cursor positioning subroutine
790 :
800 print"";:p=p-1024:py=int(p/40):px=p-40*py
810 ifpythenforpp=1topy:print"";:next
820 ifpxthenforpp=1topx:print"";:next
830 p=p+1024:return
840 :
850 rem sprite creation subroutine
860 :
870 v=53248
880 poke2040,192:poke2041,193:poke2042,194:poke2043,195
890 poke2044,195:poke2045,196:poke2046,196:poke2047,196
900 fori=39to45step2:pokev+i,1:pokev+i+1,0:next:return
910 :
920 rem activate title sprites
930 :
940 pokev,236:pokev+1,84:pokev+2,236:pokev+3,116:pokev+4,236:pokev+5,148
950 pokev+6,196:pokev+7,148:pokev+8,196:pokev+9,116:pokev+10,196:pokev+11,84
960 pokev+12,156:pokev+13,84:pokev+14,156:pokev+15,116:pokev+21,255:return
970 :
980 rem activate instruction sprites
990 :
1000 pokev,36:pokev+1,76:pokev+2,36:pokev+3,108:pokev+4,36:pokev+5,140
1010 pokev+6,252:pokev+7,140:pokev+8,252:pokev+9,108:pokev+10,252:pokev+11,76
1020 pokev+12,212:pokev+13,76:pokev+14,212:pokev+15,108:pokev+16,7:pokev+21,255
1030 return
10000 d=peek(186):n$="king puzzle":open15,d,15,"s0:"+n$:close15:saven$,d:end